package com.thirtydays.frame.module.splash

import com.blankj.utilcode.util.ThreadUtils
import com.thirtydays.frame.base.BaseActivity
import com.thirtydays.frame.base.NoViewModel
import com.thirtydays.frame.data.DataManager
import com.thirtydays.frame.databinding.ActivityAgreeBinding
import com.thirtydays.frame.module.main.MainActivity
import com.thirtydays.frame.util.LibraryHelp
import com.thirtydays.frame.util.ext.clicks

class AgreeActivity : BaseActivity<NoViewModel, ActivityAgreeBinding>() {
    override fun init() {
        setToolbar("隐私政策和用户协议")

        mViewBinding.webview.loadUrl("https://qx-h5.ixingtu.com/PrivacyPage")
    }

    override fun initListener() {
        mViewBinding.cancelAtv.clicks {
            finish()
        }

        mViewBinding.successAtv.clicks {
            DataManager.isAgree = true
            LibraryHelp.init(this)
            MainActivity.start(this)
            ThreadUtils.runOnUiThreadDelayed({
                finish()
            }, 200)
        }
    }

}